//
//  CSEncryptHelper.h
//  CSEncryptHelper
//
//  Created by luodp on 2018/5/4.
//

#import <Foundation/Foundation.h>
#import "YYKit.h"
#import "SM2Coded.h"
#import "CSEncryptMessage.h"

#define FROMSESSIONKEY    @"fromSessionKey"
#define TOSESSIONKEY      @"toSessionKey"
#define BASESESSIONDATA   @"baseSessionData" //基础会话密钥

extern NSString * const messageHeaderHexStr;


@interface CSEncryptHelper : NSObject

/** 算法类型 */
//@property (assign, nonatomic) AlgorithmType algorithmType;
/** 消息类型 */
//@property (assign, nonatomic) MessageType messageType;

@property (copy, nonatomic) NSString * selfIdentifier;
//@property (copy, nonatomic) NSString * otherIdentifier;

//@property (copy, nonatomic) NSString * otherPublic_key;
@property (copy, nonatomic) NSString * judiciaryPublic_key;
@property (copy, nonatomic) NSString * selfPublic_key;

@property (copy, nonatomic) NSString * selfPrivate_key;


+ (instancetype)sharedEncryptHelper;

+ (NSDictionary *)generyKeyPair:(NSString *) account;

- (NSData *)encrypt:(CSEncryptMessage *)message;

- (CSEncryptMessage *)decrypt:(NSData *)data;



@end
